package com.springcloud.redis.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author liyanhao
 * @Date 2022-11-25 10:18
 */
@Service
public class InGoodsService {

    @Autowired
    private RedisTemplate redisTemplate;

    @PostConstruct
    public void setGoods(){
        String key = "goods:001";
        redisTemplate.opsForValue().set(key, 50);
    }
}
